import { Controller, Post, Body } from '@nestjs/common';
import { AuthService } from './auth.service';
import { AuthDto } from './dto/create-auth.dto';
import { Public } from './decorator/public';

@Public()
@Controller('auth')
export class AuthController {
  constructor(private readonly authService: AuthService) {}

  // 注册
  @Post('signIn')
  async signIn(@Body() body: AuthDto) {
    const { username, password } = body;
    return this.authService.signIn(username, password);
  }
  // 注册
  @Post('signUp')
  signUp(@Body() body: AuthDto) {
    console.log(body);
    return this.authService.signUp(body);
  }
}
